package com.myspring.sample.factorybean;

import com.myspring.sample.model.mult_impl.MyImpl1;
import com.myspring.sample.model.mult_impl.MyInterface;
import org.springframework.beans.factory.FactoryBean;

public class MyFactoryBean implements FactoryBean<MyInterface> {
    @Override
    public MyInterface getObject() throws Exception {
        System.out.println("get object from me");

        //根据业务逻辑返回特定的实现
        return new MyImpl1();
    }

    @Override
    public Class<?> getObjectType() {
        return MyInterface.class;
    }
}
